package com.ynny.chapter04.service;

import com.ynny.chapter04.entity.User;
import com.ynny.chapter04.exception.UserNotAdminException;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl {

    public void edit(User user) {

        if (!user.getName().equals("admin")){

            //抛一个自定义异常
            throw new UserNotAdminException("用户不是管理员");
        }


    }
}
